package ace.oauth2.provider.common.properties;

import ace.oauth2.provider.common.enums.AuthorizationCodeServicesImplEnum;
import ace.oauth2.provider.common.enums.TokenStoreImplEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.collections.ListUtils;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.security.oauth2.provider.code.AuthorizationCodeServices;

import java.util.List;
import java.util.Map;
import java.util.TreeMap;

/**
 * @author Caspar
 * @contract 279397942@qq.com
 * @create 2020/1/3 15:21
 * @description oauth2 config property
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ConfigurationProperties("ace.security.oauth2")
public class OAuth2Property {
    /**
     * oauth2 clients config
     */
    private Map<String, OAuth2ClientProperty> clientProperties = new TreeMap<>();
    /**
     * oauth2 default client config
     */
    private OAuth2ClientProperty defaultClientProperty = new OAuth2ClientProperty();
    /**
     * jwt token config
     */
    private OAuth2TokenProperty tokenProperty = new OAuth2TokenProperty();
    /**
     * user details additional info
     */
    private List<String> userAdditionalInfoProperty = ListUtils.EMPTY_LIST;

    /**
     * {@link org.springframework.security.oauth2.provider.token.TokenStore} implements
     */
    private TokenStoreImplEnum tokenStoreImplEnum = TokenStoreImplEnum.REDIS_REDISSON;
    /**
     * {@link AuthorizationCodeServices} implements
     */
    private AuthorizationCodeServicesImplEnum authorizationCodeServicesImplEnum = AuthorizationCodeServicesImplEnum.REDIS_REDISSON;
}
